import { createBrowserRouter } from "react-router-dom";
import Article from "../pages/Article/Article";
import Cai from "../pages/Cai/Cai";
import Home from "../pages/Home/Home";
import Login from "../pages/Login/Login";
import Rols from "../pages/Rols/Rols";
import Shili from "../pages/Shili/Shili";
import Users from "../pages/Users/Users";
import Wen from "../pages/Wen/Wen";
import Yic from "../pages/Yic/Yic";
import Layouts from "../Layouts/Layouts.jsx";
import San from "../pages/San/San";
import Duo from "../pages/Duo/Duo";
import Pro from "../pages/Pro/Pro";
import Cha from "../pages/Cha/Cha";


export const routerlist = [
    {
        path: '/home',
        element: <Home />,
        meta: { title: '首页' }
    },
    {
        path: '/wen',
        element: <Wen />,
        meta: { title: '文档' }
    },
    {
        path: '/users',
        element: <Users />,
        meta: { title: '系统功能' }
    },
    {
        path: '/yic',
        element: <Yic />,
        meta: { title: '异常页' },

    },
    {
        path: '/shili',
        element: <Shili />,
        meta: { title: 'alova示例' }
    },
    {
        path: '/cha',
        element: <Cha />,
        meta: { title: '插件示例' }
    },
    {
        path: '/pro',
        element: <Pro />,
        meta: { title: 'Pro Naive UI 示例' }
    },
    {
        path: '/duo',
        element: <Duo />,
        meta: { title: '多级菜单' }
    },
    {
        path: '/article',
        meta: { title: '系统管理' },
        children: [
            {
                path: '/article/li',
                element: <Article />,
                meta: { title: '用户管理' }
            },
            {
                path: '/article/rols',
                element: <Rols />,
                meta: { title: '角色管理' }
            },
            {
                path: '/article/cai',
                meta: { title: '菜单管理' },
                children: [
                    {
                        path: '/article/cai/san',
                        element: <San />,
                        meta: { title: '三级' }
                    }
                ]
            },
        ]
    },
    {
        path: '/cai',
        element: <Cai />,
        meta: { title: '关于' }
    }


]

const router = createBrowserRouter([
    {
        path: '/',
        element: <Layouts />,
        children: routerlist
    },
    {
        path: '/login',
        element: <Login />
    }
])

export default router